package com.team.mp.api.controller;


import com.team.mp.api.service.intf.DoctorService;
import com.team.mp.mapper.entity.Doctor;

import com.team.mp.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * 千锋郑州Java学科欢迎你
 * @program: Tproject
 * @description: 控制层实现常用的外部接口
 * @author: xiaopi
 * @create: 2023-03-27 11:47:49
 */
@RestController
@RequestMapping("/api/doctor/")
@Api(tags = "实现Doctor的各种操作接口")
public class DoctorController{
    /**
    * 注入业务逻辑层对象*/
    @Resource
    private DoctorService service;
    /**
    * 新增内容*/
    @ApiOperation(value = "实现新增")
    @PostMapping("save.do")
    public R save(@RequestBody Doctor doctor){
       return service.save(doctor);
    }
    /**
    * 修改内容*/
    @ApiOperation(value = "实现修改")
    @PostMapping("update.do")
    public R update(@RequestBody Doctor doctor){
        return service.update(doctor);
    }
    /**
    * 查询 所有数据*/
    @ApiOperation(value = "实现全部查询")
    @GetMapping("all.do")
    public R all(){
       return service.queryAll();
    }
    /**
    * 查询 所有数据*/
    @ApiOperation(value = "实现查询单个")
    @GetMapping("single.do")
    public R single(long id){
        return service.queryById(id);
    }
    /**
    * 删除 单个数据*/
    @ApiOperation(value = "实现删除")
    @DeleteMapping("del.do")
    public R del(long id){
        return service.del(id);
    }
    /**
    * 删除 单个数据*/
    @ApiOperation(value = "医生列表")
    @PostMapping("list.do")
    public R listByCond(Integer page, Integer size, Integer partId, Integer teamId) {
        return service.listByCond(page,size,partId,teamId);
    }
}
